<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2 Final//EN">
<html>
<head>
<!-- Copyright 1997 The Open Group, All Rights Reserved -->
<title>cflow</title>
</head><body bgcolor=white>
<center>
<font size=2>
The Single UNIX &reg; Specification, Version 2<br>
Copyright &copy; 1997 The Open Group

</font></center><hr size=2 noshade>
<h4><a name = "tag_000_000_324">&nbsp;</a>NAME</h4><blockquote>
cflow - generate a C-language flowgraph (<b>DEVELOPMENT</b>)
</blockquote><h4><a name = "tag_000_000_325">&nbsp;</a>SYNOPSIS</h4><blockquote>
<pre><code>

cflow <b>[</b>r<b>][</b>-d <i>num</i><b>][</b>-D <i>name</i><b>[</b>=<i>def</i><b>]]</b> ... <b>[</b>-i <i>incl</i><b>][</b>-I <i>dir</i><b>]</b> ... <b>[</b>-U <i>dir</i><b>]</b> ...
<i>file</i> ... 
</code>
</pre>
</blockquote><h4><a name = "tag_000_000_326">&nbsp;</a>DESCRIPTION</h4><blockquote>
The
<i>cflow</i>
utility
analyses a collection of
object files or assembler,
C-language,
<i><a href="lex.html">lex</a></i>
or
<i><a href="yacc.html">yacc</a></i>
source files,
and attempts to build a graph,
written to standard output,
charting the external references.
</blockquote><h4><a name = "tag_000_000_327">&nbsp;</a>OPTIONS</h4><blockquote>
The
<i>cflow</i>
utility supports the <b>XBD</b> specification, <a href="../xbd/utilconv.html#usg"><b>Utility Syntax Guidelines</b>&nbsp;</a> ,
except that the order of the
<b>-D</b>,
<b>-I</b>
and
<b>-U</b>
options (which are identical to their interpretation by
<i><a href="c89.html">c89</a></i>)
is significant.
The following options are supported:
<dl compact>

<dt><b>-d&nbsp;</b><i>num</i>
<dd>
Indicate the depth at which the flowgraph
is cut off.
The argument
<i>num</i>
is a decimal integer.
By default this is a very large number
(typically greater than 32000).
Attempts to set
the cut-off depth to a non-positive integer will be ignored.

<dt><b>-i&nbsp;</b><i>incl</i>
<dd>Increase the number of included symbols.
The
<i>incl</i>
option-argument is one of the following characters:
<dl compact>

<dt><b>x</b><dd>Include external and static data symbols.
The default is to include
only functions in the flowgraph.

<dt><b>_</b><dd>(Underscore)
Include names that begin with an underscore.
The default is to exclude
these functions (and data if
<b>-i</b>x
is used).

</dl>
<br>
<dt><b>-r</b>
<dd>Reverse the caller:callee relationship,
producing an inverted listing
showing the callers of each function.
The listing is also sorted in
lexicographical order by callee.
<p>
</dl>
</blockquote><h4><a name = "tag_000_000_328">&nbsp;</a>OPERANDS</h4><blockquote>
The following operand is supported:
<dl compact>

<dt><i>file</i><dd>The pathname of a file for which a graph is to be generated.
Files suffixed in
<b>.l</b>,
<b>.y</b>,
<b>.c</b>
and
<b>.i</b>
are processed by
<i><a href="lex.html">lex</a></i>
and
<i><a href="yacc.html">yacc</a></i>
and preprocessed by the
<i><a href="c89.html">c89</a></i>
preprocessor phase
(bypassed for
<b>.i</b>
files) as appropriate,
and then run through the first pass of
<i><a href="lint.html">lint</a></i>.
Files suffixed with
<b>.s</b>
are assembled and information
is extracted (as in
<b>.o</b>
files)
from the symbol table.

</dl>
</blockquote><h4><a name = "tag_000_000_329">&nbsp;</a>STDIN</h4><blockquote>
Not used.
</blockquote><h4><a name = "tag_000_000_330">&nbsp;</a>INPUT FILES</h4><blockquote>
The input files are object files or assembler,
C-language,
<i><a href="lex.html">lex</a></i>
or
<i><a href="yacc.html">yacc</a></i>
source files.
</blockquote><h4><a name = "tag_000_000_331">&nbsp;</a>ENVIRONMENT VARIABLES</h4><blockquote>
The following environment variables affect the execution of
<i>cflow</i>:
<dl compact>

<dt><i>LANG</i><dd>Provide a default value for the internationalisation variables
that are unset or null.
If
<i>LANG</i>
is unset or null, the corresponding value from the
implementation-dependent default locale will be used.
If any of the internationalisation variables contains an invalid setting, the
utility will behave as if none of the variables had been defined.

<dt><i>LC_ALL</i><dd>
If set to a non-empty string value,
override the values of all the other internationalisation variables.

<dt><i>LC_COLLATE</i><dd>
Determine the locale for the
ordering of the output when the
<b>-r</b>
option is used.

<dt><i>LC_CTYPE</i><dd>
Determine the
locale for the interpretation of sequences of bytes of text data as
characters (for example, single- as opposed to multi-byte characters
in arguments and input files).

<dt><i>LC_MESSAGES</i><dd>
Determine the locale that should be used to affect
the format and contents of diagnostic
messages written to standard error.

<dt><i>NLSPATH</i><dd>
Determine the location of message catalogues
for the processing of
<i>LC_MESSAGES .
</i>
</dl>
</blockquote><h4><a name = "tag_000_000_332">&nbsp;</a>ASYNCHRONOUS EVENTS</h4><blockquote>
Default.
</blockquote><h4><a name = "tag_000_000_333">&nbsp;</a>STDOUT</h4><blockquote>
The flowgraph written to standard output is formatted as follows:
<p><code>
<tt>"%d %s:%s\n"</tt>, &lt;<i>reference&nbsp;number</i>&gt;,
&lt;<i>global</i>&gt;,
&lt;<i>definition</i>&gt;
</code>
<p>
Each line of output begins with a reference
(that is, line)
number, followed by a suitable amount of indentation
indicating the level.
This is followed by the name of the global,
a colon and its definition.
Normally globals are only functions not defined as an external or
beginning with an underscore; see the OPTIONS section for the
<b>-i</b>
inclusion option.
For information extracted from C-language source,
the definition consists of an abstract type declaration
(for example,
<b>char</b>
*) and, delimited by angle brackets,
the name of the source file
and the line number
where the definition was found.
Definitions extracted from object files
indicate the filename and location
counter under which the symbol appeared
(for example,
<i>text</i>).
<p>
Once a definition of a name has been written,
subsequent references to that name contain
only the reference number of the line
where the definition can be found.
For undefined references, only
<i>&lt;&gt</i>
is written.
</blockquote><h4><a name = "tag_000_000_334">&nbsp;</a>STDERR</h4><blockquote>
Used only for diagnostic messages.
</blockquote><h4><a name = "tag_000_000_335">&nbsp;</a>OUTPUT FILES</h4><blockquote>
None.
</blockquote><h4><a name = "tag_000_000_336">&nbsp;</a>EXTENDED DESCRIPTION</h4><blockquote>
None.
</blockquote><h4><a name = "tag_000_000_337">&nbsp;</a>EXIT STATUS</h4><blockquote>
The following exit values are returned:
<dl compact>

<dt>0<dd>Successful completion.

<dt>&gt;0<dd>An error occurred.

</dl>
</blockquote><h4><a name = "tag_000_000_338">&nbsp;</a>CONSEQUENCES OF ERRORS</h4><blockquote>
Default.
</blockquote><h4><a name = "tag_000_000_339">&nbsp;</a>APPLICATION USAGE</h4><blockquote>
Files produced by
<i><a href="lex.html">lex</a></i>
and
<i><a href="yacc.html">yacc</a></i>
cause the reordering of line number declarations, and this can
confuse
<i>cflow</i>.
To obtain proper results, the input of
<i><a href="yacc.html">yacc</a></i>
or
<i><a href="lex.html">lex</a></i>
must be directed to
<i>cflow</i>.
<br>
</blockquote><h4><a name = "tag_000_000_340">&nbsp;</a>EXAMPLES</h4><blockquote>
Given the following in
<b>file.c</b>:
<pre>
<code>
int i;

main()
{
    f();
    g();
    f();
}

f()
{
    i = h();
}
</code>
</pre>
The command:
<pre>
<code>
cflow -i x file.c
</code>
</pre>
produces the output:
<pre>
<code>
1 main: int(), &lt;file.c 4&gt;
2     f: int(), &lt;file.c 11&gt;
3         h: &lt;&gt;
4         i: int, &lt;file.c 1&gt;
5     g: &lt;&gt;
</code>
</pre>
</blockquote><h4><a name = "tag_000_000_341">&nbsp;</a>FUTURE DIRECTIONS</h4><blockquote>
None.
<br>
</blockquote><h4><a name = "tag_000_000_342">&nbsp;</a>SEE ALSO</h4><blockquote>
<i><a href="cc.html">cc</a></i>,
<i><a href="c89.html">c89</a></i>,
<i><a href="lex.html">lex</a></i>,
<i><a href="yacc.html">yacc</a></i>.
</blockquote><hr size=2 noshade>
<center><font size=2>
UNIX &reg; is a registered Trademark of The Open Group.<br>
Copyright &copy; 1997 The Open Group
<br> [ <a href="../index.html">Main Index</a> | <a href="../xshix.html">XSH</a> | <a href="../xcuix.html">XCU</a> | <a href="../xbdix.html">XBD</a> | <a href="../cursesix.html">XCURSES</a> | <a href="../xnsix.html">XNS</a> ]

</font></center><hr size=2 noshade>
</body></html>
